import jsonschema
import requests

class Testlogin:
    def test01(self):
        url="http://ihrm-test.itheima.net/api/sys/login"
        login_data={
            "mobile":"13800000002",
            "password":"123456"
        }
        response = requests.post(url=url,json=login_data)
        print(response.json())

        my_schema={
            "type":"object",
            "properties":{
                "success":{"const":True},
                "code": {"const": 10000},
                "message": {"pattern": "成功"},
                "date":{"type":"string"}
            }
        }

        jsonschema.validate(response.json(),my_schema)